]> dgit.raspbian.org Git - gnome-shell.git/commitdiff
style: Stop using braces for single-line arrow functions
authorFlorian Müllner <fmuellner@gnome.org>
Mon, 28 Jan 2019 00:42:00 +0000 (01:42 +0100)
committerGeorges Basile Stavracas Neto <georges.stavracas@gmail.com>
Tue, 2 Jul 2019 12:17:46 +0000 (12:17 +0000)
Braces are optional for single-line arrow functions, but there's a
subtle difference:
Without braces, the expression is implicitly used as return value; with
braces, the function returns nothing unless there's an explicit return.

We currently reflect that in our style by only omitting braces when the
function is expected to have a return value, but that's not very obvious,
not an important differentiation to make, and not easy to express in an
automatic rule.

So just omit braces consistently as mandated by gjs' coding style.

https://gitlab.gnome.org/GNOME/gnome-shell/merge_requests/608

39 files changed:
js/gdm/authPrompt.js
js/gdm/loginDialog.js
js/gdm/realmd.js
js/misc/ibusManager.js
js/misc/systemActions.js
js/misc/util.js
js/misc/weather.js
js/perf/hwtest.js
js/portalHelper/main.js
js/ui/accessDialog.js
js/ui/altTab.js
js/ui/appDisplay.js
js/ui/audioDeviceSelection.js
js/ui/calendar.js
js/ui/components/networkAgent.js
js/ui/ctrlAltTab.js
js/ui/dateMenu.js
js/ui/edgeDragAction.js
js/ui/iconGrid.js
js/ui/keyboard.js
js/ui/lookingGlass.js
js/ui/osdWindow.js
js/ui/padOsd.js
js/ui/panel.js
js/ui/panel.js. [new file with mode: 0644]
js/ui/popupMenu.js
js/ui/runDialog.js
js/ui/screenShield.js
js/ui/shellEntry.js
js/ui/shellMountOperation.js
js/ui/status/keyboard.js
js/ui/status/network.js
js/ui/status/system.js
js/ui/status/thunderbolt.js
js/ui/switcherPopup.js
js/ui/tweener.js
js/ui/windowAttentionHandler.js
js/ui/windowManager.js
js/ui/workspace.js

index f6cd9aa79e1db93a0cf24a1d0b4d7efcee45f30f..c9ab360731ebf4968c7578952ac224f1288246fc 100644 (file)
@@ -138,7 +138,7 @@ var AuthPrompt = class {
                                             reactive: true,
                                             can_focus: true,
                                             label: _("Cancel") });
-        this.cancelButton.connect('clicked', () => { this.cancel(); });
+        this.cancelButton.connect('clicked', () => this.cancel());
         this._buttonBox.add(this.cancelButton,
                             { expand: false,
                               x_fill: false,
@@ -157,7 +157,7 @@ var AuthPrompt = class {
                                           reactive: true,
                                           can_focus: true,
                                           label: _("Next") });
-        this.nextButton.connect('clicked', () => { this.emit('next'); });
+        this.nextButton.connect('clicked', () => this.emit('next'));
         this.nextButton.add_style_pseudo_class('default');
         this._buttonBox.add(this.nextButton,
                             { expand: false,
index 5c3cdd57dcff36a5530e4a4daf5054abfe103a25..9412bc2db291498bc19c3946f2f725ecc890e837 100644 (file)
@@ -259,7 +259,7 @@ var UserList = class {
         item.connect('activate', this._onItemActivated.bind(this));
 
         // Try to keep the focused item front-and-center
-        item.actor.connect('key-focus-in', () => { this.scrollToItem(item); });
+        item.actor.connect('key-focus-in', () => this.scrollToItem(item));
 
         this._moveFocusToItems();
 
@@ -327,7 +327,7 @@ var SessionMenuButton = class {
                                                        { actionMode: Shell.ActionMode.NONE });
         this._manager.addMenu(this._menu);
 
-        this._button.connect('clicked', () => { this._menu.toggle(); });
+        this._button.connect('clicked', () => this._menu.toggle());
 
         this._items = {};
         this._activeSessionId = null;
@@ -955,7 +955,7 @@ var LoginDialog = GObject.registerClass({
     }
 
     _onSessionOpened(client, serviceName) {
-        this._authPrompt.finish(() => { this._startSession(serviceName); });
+        this._authPrompt.finish(() => this._startSession(serviceName));
     }
 
     _waitForItemForUser(userName) {
@@ -973,7 +973,7 @@ var LoginDialog = GObject.registerClass({
                     hold.release();
             });
 
-        hold.connect('release', () => { this._userList.disconnect(signalId); });
+        hold.connect('release', () => this._userList.disconnect(signalId));
 
         return hold;
     }
index f00d3023a4961b6e3022d2b1f57495ee2bcb6dae..ed02d601ad2ed99e39007c5703d0c85ef430d1af 100644 (file)
@@ -98,7 +98,7 @@ var Manager = class {
         Service(Gio.DBus.system,
                 'org.freedesktop.realmd',
                 '/org/freedesktop/realmd',
-                service => { service.ReleaseRemote(); });
+                service => service.ReleaseRemote());
         this._aggregateProvider.disconnect(this._signalId);
         this._realms = { };
         this._updateLoginFormat();
index a01d31254692bca4aea2b752f5bbbe398b6b5b5b..338542a1364108187ddb21156703377da8aad2aa 100644 (file)
@@ -119,7 +119,7 @@ var IBusManager = class {
                 if (!GLib.str_has_suffix(path, '/InputContext_1'))
                     this.emit ('focus-in');
             });
-            this._panelService.connect('focus-out', () => { this.emit('focus-out'); });
+            this._panelService.connect('focus-out', () => this.emit('focus-out'));
 
             try {
                 // IBus versions older than 1.5.10 have a bug which
index 008cf2902c8ae0e804dbad91791e29fdd761820a..cbd9f25673acbaf46f432b549c6019bdba30d365 100644 (file)
@@ -143,26 +143,26 @@ const SystemActions = GObject.registerClass({
         this._userManager = AccountsService.UserManager.get_default();
 
         this._userManager.connect('notify::is-loaded',
-                                  () => { this._updateMultiUser(); });
+                                  () => this._updateMultiUser());
         this._userManager.connect('notify::has-multiple-users',
-                                  () => { this._updateMultiUser(); });
+                                  () => this._updateMultiUser());
         this._userManager.connect('user-added',
-                                  () => { this._updateMultiUser(); });
+                                  () => this._updateMultiUser());
         this._userManager.connect('user-removed',
-                                  () => { this._updateMultiUser(); });
+                                  () => this._updateMultiUser());
 
         this._lockdownSettings.connect('changed::' + DISABLE_USER_SWITCH_KEY,
-                                       () => { this._updateSwitchUser(); });
+                                       () => this._updateSwitchUser());
         this._lockdownSettings.connect('changed::' + DISABLE_LOG_OUT_KEY,
-                                       () => { this._updateLogout(); });
+                                       () => this._updateLogout());
         global.settings.connect('changed::' + ALWAYS_SHOW_LOG_OUT_KEY,
-                                () => { this._updateLogout(); });
+                                () => this._updateLogout());
 
         this._lockdownSettings.connect('changed::' + DISABLE_LOCK_SCREEN_KEY,
-                                       () => { this._updateLockScreen(); });
+                                       () => this._updateLockScreen());
 
         this._lockdownSettings.connect('changed::' + DISABLE_LOG_OUT_KEY,
-                                       () => { this._updateHaveShutdown(); });
+                                       () => this._updateHaveShutdown());
 
         this.forceUpdate();
 
@@ -172,10 +172,10 @@ const SystemActions = GObject.registerClass({
                                               this._updateOrientationLockIcon();
                                           });
         Main.layoutManager.connect('monitors-changed',
-                                   () => { this._updateOrientationLock(); });
+                                   () => this._updateOrientationLock());
         Gio.DBus.system.watch_name(SENSOR_BUS_NAME,
                                    Gio.BusNameWatcherFlags.NONE,
-                                   () => { this._sensorProxyAppeared(); },
+                                   () => this._sensorProxyAppeared(),
                                    () => {
                                        this._sensorProxy = null;
                                        this._updateOrientationLock();
@@ -183,7 +183,7 @@ const SystemActions = GObject.registerClass({
         this._updateOrientationLock();
         this._updateOrientationLockIcon();
 
-        Main.sessionMode.connect('updated', () => { this._sessionUpdated(); });
+        Main.sessionMode.connect('updated', () => this._sessionUpdated());
         this._sessionUpdated();
     }
 
@@ -223,7 +223,7 @@ const SystemActions = GObject.registerClass({
                     return;
                 }
                 this._sensorProxy.connect('g-properties-changed',
-                                          () => { this._updateOrientationLock(); });
+                                          () => this._updateOrientationLock());
                 this._updateOrientationLock();
             });
     }
@@ -265,7 +265,7 @@ const SystemActions = GObject.registerClass({
 
     getMatchingActions(terms) {
         // terms is a list of strings
-        terms = terms.map((term) => { return term.toLowerCase(); });
+        terms = terms.map((term) => term.toLowerCase());
 
         let results = [];
 
index f2795aa15b9754a11c6ab16b7ce358ad1671c8ce..036207cc1f51add5726ced1828c80f792b750db2 100644 (file)
@@ -288,7 +288,7 @@ function createTimeLabel(date, params) {
     let id = _desktopSettings.connect('changed::clock-format', () => {
         label.text = formatTime(date, params);
     });
-    label.connect('destroy', () => { _desktopSettings.disconnect(id); });
+    label.connect('destroy', () => _desktopSettings.disconnect(id));
     return label;
 }
 
@@ -492,13 +492,13 @@ var AppSettingsMonitor = class {
     }
 
     _setSettings(settings) {
-        this._handlers.forEach((handler) => { this._disconnectHandler(handler); });
+        this._handlers.forEach((handler) => this._disconnectHandler(handler));
 
         let hadSettings = (this._settings != null);
         this._settings = settings;
         let haveSettings = (this._settings != null);
 
-        this._handlers.forEach((handler) => { this._connectHandler(handler); });
+        this._handlers.forEach((handler) => this._connectHandler(handler));
 
         if (hadSettings != haveSettings)
             this.emit('available-changed');
index 66d89fe9475ffc94059131073c04480178750f66..b1eee3aff69888ca4a9b846754a41fe3e77380a0 100644 (file)
@@ -68,7 +68,7 @@ var WeatherClient = class {
 
         this._weatherAppMon = new Util.AppSettingsMonitor('org.gnome.Weather.desktop',
                                                           'org.gnome.Weather');
-        this._weatherAppMon.connect('available-changed', () => { this.emit('changed'); });
+        this._weatherAppMon.connect('available-changed', () => this.emit('changed'));
         this._weatherAppMon.watchSetting('automatic-location',
                                          this._onAutomaticLocationChanged.bind(this));
         this._weatherAppMon.watchSetting('locations',
index cf16b06bbeaae920d62dc1ba32713e59a53f903c..b0de64f11f7cffffa80131f3683ddaf890d4d4de 100644 (file)
@@ -48,7 +48,7 @@ function waitAndDraw(milliseconds) {
             cb();
     });
 
-    return callback => { cb = callback; };
+    return callback => cb = callback;
 }
 
 function waitSignal(object, signal) {
@@ -60,7 +60,7 @@ function waitSignal(object, signal) {
             cb();
     });
 
-    return callback => { cb = callback; };
+    return callback => cb = callback;
 }
 
 function extractBootTimestamp() {
index bd5fa9e308eefa59d446a66ad94938250c618db7..ba4760a5cfa6f6f7bd7a9e06badea30580672427 100644 (file)
@@ -264,7 +264,7 @@ class WebPortalHelper extends Gtk.Application {
         this._queue = [];
 
         let action = new Gio.SimpleAction({ name: 'quit' });
-        action.connect('activate', () => { this.active_window.destroyWindow(); });
+        action.connect('activate', () => this.active_window.destroyWindow());
         this.add_action(action);
     }
 
index a13bfa8317a4eedb5e24c6ef233f79f621eb9304..46778739bce8ff8e5ce83fbff63e044d8ebb2574 100644 (file)
@@ -146,7 +146,7 @@ var AccessDialogDBus = class {
                                       subtitle, body, options);
         dialog.open();
 
-        dialog.connect('closed', () => { this._accessDialog = null; });
+        dialog.connect('closed', () => this._accessDialog = null);
 
         this._accessDialog = dialog;
     }
index 2a32aca7b941923b9e589ff5b5539b3b556735cc..76679dc7f9efdae681e0ae3d6c8132b1f069d3bc 100644 (file)
@@ -395,7 +395,7 @@ class AppSwitcherPopup extends SwitcherPopup.SwitcherPopup {
                          { opacity: 255,
                            time: THUMBNAIL_FADE_TIME,
                            transition: 'easeOutQuad',
-                           onComplete: () => { this.thumbnailsVisible = true; }
+                           onComplete: () => this.thumbnailsVisible = true
                          });
 
         this._switcherList._items[this._selectedIndex].add_accessible_state (Atk.StateType.EXPANDED);
@@ -843,7 +843,7 @@ class AppSwitcher extends SwitcherPopup.SwitcherList {
         });
 
         let arrow = new St.DrawingArea({ style_class: 'switcher-arrow' });
-        arrow.connect('repaint', () => { SwitcherPopup.drawArrow(arrow, St.Side.BOTTOM); });
+        arrow.connect('repaint', () => SwitcherPopup.drawArrow(arrow, St.Side.BOTTOM));
         this.add_actor(arrow);
         this._arrows.push(arrow);
 
index 9978e9f66a13ca6ae486777c37d17429718a6781..661b0f98ccd5c6446bdcda986038a5eced67c3fa 100644 (file)
@@ -143,7 +143,7 @@ class BaseAppView {
 
     loadGrid() {
         this._allItems.sort(this._compareItems);
-        this._allItems.forEach(item => { this._grid.addItem(item); });
+        this._allItems.forEach(item => this._grid.addItem(item));
         this.emit('view-loaded');
     }
 
@@ -212,7 +212,7 @@ class BaseAppView {
         } else {
             params.opacity = 0;
             params.delay = 0;
-            params.onComplete = () => { this.actor.hide(); };
+            params.onComplete = () => this.actor.hide();
         }
 
         Tweener.addTween(this._grid, params);
@@ -285,7 +285,7 @@ var AllView = class AllView extends BaseAppView {
         this._availWidth = 0;
         this._availHeight = 0;
 
-        Main.overview.connect('hidden', () => { this.goToPage(0); });
+        Main.overview.connect('hidden', () => this.goToPage(0));
         this._grid.connect('space-opened', () => {
             let fadeEffect = this._scrollView.get_effect('fade');
             if (fadeEffect)
@@ -1299,7 +1299,7 @@ var AppFolderPopup = class AppFolderPopup {
 
         global.focus_manager.add_group(this.actor);
 
-        source.actor.connect('destroy', () => { this.actor.destroy(); });
+        source.actor.connect('destroy', () => this.actor.destroy());
         this._grabHelper = new GrabHelper.GrabHelper(this.actor, {
             actionMode: Shell.ActionMode.POPUP
         });
index 8ee00025c0f546e1eb62b8c0d927600ee1954da8..06459846ae61d5ff2e9f9ca35294a069584964a9 100644 (file)
@@ -159,7 +159,7 @@ var AudioDeviceSelectionDBus = class AudioDeviceSelectionDBus {
 
         let [deviceNames] = params;
         let devices = 0;
-        deviceNames.forEach(n => { devices |= AudioDevice[n.toUpperCase()]; });
+        deviceNames.forEach(n => devices |= AudioDevice[n.toUpperCase()]);
 
         let dialog;
         try {
index e253f84699108e0b52373c1ed2270f9c9f2517a2..ff0816eed655ebbe6d1874a89cfee6a386be58d6 100644 (file)
@@ -1072,7 +1072,7 @@ var CalendarMessageList = class CalendarMessageList {
         this._clearButton.set_x_align(Clutter.ActorAlign.END);
         this._clearButton.connect('clicked', () => {
             let sections = [...this._sections.keys()];
-            sections.forEach((s) => { s.clear(); });
+            sections.forEach((s) => s.clear());
         });
         box.add_actor(this._clearButton);
 
index bd8faea6d6b15a211beaaf5a741b1aab91aab78d..37352aef8d244e7a1113c116c02b3c242d648ac3 100644 (file)
@@ -620,7 +620,7 @@ var NetworkAgent = class {
         this._pluginDir = Gio.file_new_for_path(Config.VPNDIR);
         try {
             let monitor = this._pluginDir.monitor(Gio.FileMonitorFlags.NONE, null);
-            monitor.connect('changed', () => { this._vpnCacheBuilt = false; });
+            monitor.connect('changed', () => this._vpnCacheBuilt = false);
         } catch (e) {
             log('Failed to create monitor for VPN plugin dir: ' + e.message);
         }
index a075ca151f693484edbccd18ff638644fea4a873..015badfbcd7ddb66e4257a3ef93382cff4e45c68 100644 (file)
@@ -32,7 +32,7 @@ var CtrlAltTabManager = class CtrlAltTabManager {
         item.iconName = icon;
 
         this._items.push(item);
-        root.connect('destroy', () => { this.removeGroup(root); });
+        root.connect('destroy', () => this.removeGroup(root));
         if (root instanceof St.Widget)
             global.focus_manager.add_group(root);
     }
index a333bc938dff04c56fc4bab5f676c25b90a76669..87979bd616525be3f81d7421d1beaba3bf083045 100644 (file)
@@ -357,7 +357,7 @@ var MessagesIndicator = class MessagesIndicator {
         Main.messageTray.connect('queue-changed', this._updateCount.bind(this));
 
         let sources = Main.messageTray.getSources();
-        sources.forEach(source => { this._onSourceAdded(null, source); });
+        sources.forEach(source => this._onSourceAdded(null, source));
     }
 
     _onSourceAdded(tray, source) {
@@ -373,7 +373,7 @@ var MessagesIndicator = class MessagesIndicator {
 
     _updateCount() {
         let count = 0;
-        this._sources.forEach(source => { count += source.unseenCount; });
+        this._sources.forEach(source => count += source.unseenCount);
         count -= Main.messageTray.queueCount;
 
         this.actor.visible = (count > 0);
@@ -384,8 +384,8 @@ var IndicatorPad = GObject.registerClass(
 class IndicatorPad extends St.Widget {
     _init(actor) {
         this._source = actor;
-        this._source.connect('notify::visible', () => { this.queue_relayout(); });
-        this._source.connect('notify::size', () => { this.queue_relayout(); });
+        this._source.connect('notify::visible', () => this.queue_relayout());
+        this._source.connect('notify::size', () => this.queue_relayout());
         super._init();
     }
 
index e811dda216741b8847bd15ed8af364268d9ad675..7b048c691c743ce4c6f5b35abeaee66fe70a7bd3 100644 (file)
@@ -16,7 +16,7 @@ var EdgeDragAction = GObject.registerClass({
         this._allowedModes = allowedModes;
         this.set_n_touch_points(1);
 
-        global.display.connect('grab-op-begin', () => { this.cancel(); });
+        global.display.connect('grab-op-begin', () => this.cancel());
     }
 
     _getMonitorRect(x, y) {
index c2c7c85a866579739d42dc8f3197649418692816..3c0bd3cd2434e9ea149928658fa4bca57dc2f2ab 100644 (file)
@@ -402,7 +402,7 @@ var IconGrid = GObject.registerClass({
     }
 
     _cancelAnimation() {
-        this._clonesAnimating.forEach(clone => { clone.destroy(); });
+        this._clonesAnimating.forEach(clone => clone.destroy());
         this._clonesAnimating = [];
     }
 
@@ -967,7 +967,7 @@ var PaginatedIconGrid = GObject.registerClass({
                            transition: 'easeInOutQuad'
                          };
             if (i == (children.length - 1))
-                params.onComplete = () => { this.emit('space-opened'); };
+                params.onComplete = () => this.emit('space-opened');
             Tweener.addTween(children[i], params);
         }
     }
@@ -985,7 +985,7 @@ var PaginatedIconGrid = GObject.registerClass({
                              { translation_y: 0,
                                time: EXTRA_SPACE_ANIMATION_TIME,
                                transition: 'easeInOutQuad',
-                               onComplete: () => { this.emit('space-closed'); }
+                               onComplete: () => this.emit('space-closed')
                              });
         }
     }
index 16e064a377aca57fb69c53deb8b1c519e2d385cc..f84569c6931def39c3155658b8825e5c4b78da21 100644 (file)
@@ -862,7 +862,7 @@ var EmojiSelection = class EmojiSelection {
                                         x_expand: true,
                                         y_expand: true,
                                         vertical: true });
-        this.actor.connect('notify::mapped', () => { this._emojiPager.setCurrentPage(0); });
+        this.actor.connect('notify::mapped', () => this._emojiPager.setCurrentPage(0));
 
         this._emojiPager = new EmojiPager(this._sections, 11, 3);
         this._emojiPager.connect('page-changed', (pager, section, page, nPages) => {
@@ -944,14 +944,14 @@ var EmojiSelection = class EmojiSelection {
 
         key = new Key('ABC', []);
         key.keyButton.add_style_class_name('default-key');
-        key.connect('released', () => { this.emit('toggle'); });
+        key.connect('released', () => this.emit('toggle'));
         row.appendKey(key.actor, 1.5);
 
         for (let i = 0; i < this._sections.length; i++) {
             let section = this._sections[i];
 
             key = new Key(section.label, []);
-            key.connect('released', () => { this._emojiPager.setCurrentSection(section, 0); });
+            key.connect('released', () => this._emojiPager.setCurrentSection(section, 0));
             row.appendKey(key.actor);
 
             section.button = key;
@@ -1171,7 +1171,7 @@ var Keyboard = class Keyboard {
 
         this._emojiSelection = new EmojiSelection();
         this._emojiSelection.connect('toggle', this._toggleEmoji.bind(this));
-        this._emojiSelection.connect('hide', (selection) => { this.hide(); });
+        this._emojiSelection.connect('hide', (selection) => this.hide());
         this._emojiSelection.connect('emoji-selected', (selection, emoji) => {
             this._keyboardController.commitString(emoji);
         });
index 9df407c6ccbdb37d236ef58a6487608e56dbc392..6de84002b912fb9afac0cf7432b402a62a343aea 100644 (file)
@@ -146,8 +146,8 @@ var Notebook = class Notebook {
         this.actor.add(scrollview, { expand: true });
 
         let vAdjust = scrollview.vscroll.adjustment;
-        vAdjust.connect('changed', () => { this._onAdjustScopeChanged(tabData); });
-        vAdjust.connect('notify::value', () => { this._onAdjustValueChanged(tabData); });
+        vAdjust.connect('changed', () => this._onAdjustScopeChanged(tabData));
+        vAdjust.connect('notify::value', () => this._onAdjustValueChanged(tabData));
 
         if (this._selectedIndex == -1)
             this.selectIndex(0);
@@ -1007,7 +1007,7 @@ var LookingGlass = class LookingGlass {
     }
 
     _queueResize() {
-        Meta.later_add(Meta.LaterType.BEFORE_REDRAW, () => { this._resize(); });
+        Meta.later_add(Meta.LaterType.BEFORE_REDRAW, () => this._resize());
     }
 
     _resize() {
index 58d8e67916d00f64a65d1060372de511a44f74a9..3730d6b20178b4372cec56b6e7cdae57977cb15f 100644 (file)
@@ -21,7 +21,7 @@ var LevelBar = class extends BarLevel.BarLevel {
 
         this.actor.accessible_name = _("Volume");
 
-        this.actor.connect('notify::width', () => { this.level = this.level; });
+        this.actor.connect('notify::width', () => this.level = this.level);
     }
 
     get level() {
index ed3607d8faef4c763b0828cb442af25a2c31a0ad..2fc81d3368c44bc22921254ec0dcc1b97435cb74 100644 (file)
@@ -186,7 +186,7 @@ var ActionComboBox = class {
     }
 
     setButtonActionsActive(active) {
-        this._buttonItems.forEach(item => { item.setSensitive(active); });
+        this._buttonItems.forEach(item => item.setSensitive(active));
     }
 };
 Signals.addSignalMethods(ActionComboBox.prototype);
index cf8b64fe47792ec7f83eeaba6a926bf4c590cb9d..1a5d9b95a6b2475af4b79db89969bbc3e8502134 100644 (file)
@@ -862,7 +862,7 @@ class Panel extends St.Widget {
 
         Main.sessionMode.connect('updated', this._updatePanel.bind(this));
 
-        global.display.connect('workareas-changed', () => { this.queue_relayout(); });
+        global.display.connect('workareas-changed', () => this.queue_relayout());
         this._updatePanel();
     }
 
diff --git a/js/ui/panel.js. b/js/ui/panel.js.
new file mode 100644 (file)
index 0000000..e69de29
index 6f58af634069b3673f09a5f44c631e2e20e09a96..846a67b84add84716467e10ab08733337b84bdeb 100644 (file)
@@ -1134,7 +1134,7 @@ class PopupSubMenuMenuItem extends PopupBaseMenuItem {
 
         this.menu = new PopupSubMenu(this, this._triangle);
         this.menu.connect('open-state-changed', this._subMenuOpenStateChanged.bind(this));
-        this.connect('destroy', () => { this.menu.destroy(); });
+        this.connect('destroy', () => this.menu.destroy());
     }
 
     _setParent(parent) {
index 76b950713413d01eb8d56e3c19d49a5042f1ef6e..211fb225fdc3f0d6393c66cf50c47eb2f703400f 100644 (file)
@@ -34,14 +34,14 @@ class RunDialog extends ModalDialog.ModalDialog {
         this._enableInternalCommands = global.settings.get_boolean('development-tools');
 
         this._internalCommands = {
-            'lg': () => { Main.createLookingGlass().open(); },
+            'lg': () => Main.createLookingGlass().open(),
 
             'r': this._restart.bind(this),
 
             // Developer brain backwards compatibility
             'restart': this._restart.bind(this),
 
-            'debugexit': () => { Meta.quit(Meta.ExitCode.ERROR); },
+            'debugexit': () => Meta.quit(Meta.ExitCode.ERROR),
 
             // rt is short for "reload theme"
             'rt': () => {
index 698b8be24fb5c51aed2837d48501d2eba0bc6102..18f98461fb0dba105dfa79039a5f1384a6ef996a 100644 (file)
@@ -529,9 +529,9 @@ var ScreenShield = class {
         this._loginManager.getCurrentSessionProxy(sessionProxy => {
             this._loginSession = sessionProxy;
             this._loginSession.connectSignal('Lock',
-                                             () => { this.lock(false); });
+                                             () => this.lock(false));
             this._loginSession.connectSignal('Unlock',
-                                             () => { this.deactivate(false); });
+                                             () => this.deactivate(false));
             this._loginSession.connect('g-properties-changed', this._syncInhibitor.bind(this));
             this._syncInhibitor();
         });
@@ -1177,7 +1177,7 @@ var ScreenShield = class {
 
     deactivate(animate) {
         if (this._dialog)
-            this._dialog.finish(() => { this._continueDeactivate(animate); });
+            this._dialog.finish(() => this._continueDeactivate(animate));
         else
             this._continueDeactivate(animate);
     }
index c3130c526ae210e01b6ef9bb3753e66f1bdfb5b3..da4ba442b01bb997c0ff13978f7042f82f0997a7 100644 (file)
@@ -162,7 +162,7 @@ function addContextMenu(entry, params) {
         _onButtonPressEvent(actor, event, entry);
     });
 
-    entry.connect('popup-menu', actor => { _onPopup(actor, entry); });
+    entry.connect('popup-menu', actor => _onPopup(actor, entry));
 
     entry.connect('destroy', () => {
         entry.menu.destroy();
index feeda0667c25b148b64625f9acf815935dba76ba..db6b0be18100f2588a5f610105b0a77cb61b0396 100644 (file)
@@ -26,7 +26,7 @@ function _setButtonsForChoices(dialog, choices) {
     for (let idx = 0; idx < choices.length; idx++) {
         let button = idx;
         buttons.unshift({ label: choices[idx],
-                          action: () => { dialog.emit('response', button); }
+                          action: () => dialog.emit('response', button)
                         });
     }
 
index 1a1dceef72a72c0614021ec75c2609cf6da0b8a8..3f73640819e9c1677b7cad62fdbaba7e498973ab 100644 (file)
@@ -875,7 +875,7 @@ class InputSourceIndicator extends PanelMenu.Button {
             let is = this._inputSourceManager.inputSources[i];
 
             let menuItem = new LayoutMenuItem(is.displayName, is.shortName);
-            menuItem.connect('activate', () => { is.activate(true); });
+            menuItem.connect('activate', () => is.activate(true));
 
             let indicatorLabel = new St.Label({ text: is.shortName,
                                                 visible: false });
index 05c830c090bdea329e81c13c93f6f8e6cdb85cec..3604b056f0b96e7278cf459b59bbf472cbe48d57 100644 (file)
@@ -270,7 +270,7 @@ var NMConnectionSection = class NMConnectionSection {
         if (!item)
             return;
 
-        item.connect('icon-changed', () => { this._iconChanged(); });
+        item.connect('icon-changed', () => this._iconChanged());
         item.connect('activation-failed', (item, reason) => {
             this.emit('activation-failed', reason);
         });
@@ -630,9 +630,9 @@ var NMWirelessDialogItem = GObject.registerClass({
                       can_focus: true,
                       reactive: true });
 
-        this.connect('key-focus-in', () => { this.emit('selected'); });
+        this.connect('key-focus-in', () => this.emit('selected'));
         let action = new Clutter.ClickAction();
-        action.connect('clicked', () => { this.grab_key_focus(); });
+        action.connect('clicked', () => this.grab_key_focus());
         this.add_action(action);
 
         let title = ssidToLabel(this._ap.get_ssid());
@@ -1675,7 +1675,7 @@ var NMApplet = class extends PanelMenu.SystemIndicator {
                                                   'network-transmit-receive');
             this._source.policy = new MessageTray.NotificationApplicationPolicy('gnome-network-panel');
 
-            this._source.connect('destroy', () => { this._source = null; });
+            this._source.connect('destroy', () => this._source = null);
             Main.messageTray.add(this._source);
         }
     }
index 68c20e2244425dcc006b4de2a58e0620ddfa4d05..adb32116f8bb9840a7a3acc69b08120f494214f6 100644 (file)
@@ -15,13 +15,13 @@ var AltSwitcher = class {
         this._standard.connect('notify::visible', this._sync.bind(this));
         if (this._standard instanceof St.Button)
             this._standard.connect('clicked',
-                                   () => { this._clickAction.release(); });
+                                   () => this._clickAction.release());
 
         this._alternate = alternate;
         this._alternate.connect('notify::visible', this._sync.bind(this));
         if (this._alternate instanceof St.Button)
             this._alternate.connect('clicked',
-                                    () => { this._clickAction.release(); });
+                                    () => this._clickAction.release());
 
         this._capturedEventId = global.stage.connect('captured-event', this._onCapturedEvent.bind(this));
 
@@ -32,7 +32,7 @@ var AltSwitcher = class {
 
         this.actor = new St.Bin();
         this.actor.connect('destroy', this._onDestroy.bind(this));
-        this.actor.connect('notify::mapped', () => { this._flipped = false; });
+        this.actor.connect('notify::mapped', () => this._flipped = false);
     }
 
     _sync() {
@@ -117,9 +117,9 @@ var Indicator = class extends PanelMenu.SystemIndicator {
         this._createSubMenu();
 
         this._loginScreenItem.connect('notify::visible',
-                                      () => { this._updateMultiUser(); });
+                                      () => this._updateMultiUser());
         this._logoutItem.connect('notify::visible',
-                                 () => { this._updateMultiUser(); });
+                                 () => this._updateMultiUser());
         // Whether shutdown is available or not depends on both lockdown
         // settings (disable-log-out) and Polkit policy - the latter doesn't
         // notify, so we update the menu item each time the menu opens or
@@ -303,13 +303,13 @@ var Indicator = class extends PanelMenu.SystemIndicator {
 
 
         this._settingsAction.connect('notify::visible',
-                                     () => { this._updateActionsVisibility(); });
+                                     () => this._updateActionsVisibility());
         this._orientationLockAction.connect('notify::visible',
-                                            () => { this._updateActionsVisibility(); });
+                                            () => this._updateActionsVisibility());
         this._lockScreenAction.connect('notify::visible',
-                                       () => { this._updateActionsVisibility(); });
+                                       () => this._updateActionsVisibility());
         this._altSwitcher.actor.connect('notify::visible',
-                                        () => { this._updateActionsVisibility(); });
+                                        () => this._updateActionsVisibility());
     }
 
     _onSettingsClicked() {
index 2becaf2454ab563442d9e3b013766bc9e5ee5438..8ce1652e350124cf575a9e5a458ebcffcca92348 100644 (file)
@@ -259,7 +259,7 @@ var Indicator = class extends PanelMenu.SystemIndicator {
         if (!this._source) {
             this._source = new MessageTray.Source(_("Thunderbolt"),
                                                   'thunderbolt-symbolic');
-            this._source.connect('destroy', () => { this._source = null; });
+            this._source.connect('destroy', () => this._source = null);
 
             Main.messageTray.add(this._source);
         }
index d7b11f982fe8d9ecc9438c0c5c813c1ee4ae4011..89fe08afcaefcf4860cd72833563fbe870bbeb0e 100644 (file)
@@ -392,7 +392,7 @@ var SwitcherList = GObject.registerClass({
         this._list.add_actor(bbox);
 
         let n = this._items.length;
-        bbox.connect('clicked', () => { this._onItemClicked(n); });
+        bbox.connect('clicked', () => this._onItemClicked(n));
         bbox.connect('motion-event', () => this._onItemEnter(n));
 
         bbox.label_actor = label;
index 2edbdc8ef0aeb3c9d021b27481662fd3021f3e6f..ebd47517082f9070fa307a3e7629e2f6ed2393e4 100644 (file)
@@ -43,7 +43,7 @@ function _wrapTweening(target, tweeningParameters) {
             state.destroyedId = target.connect('destroy', _actorDestroyed);
         } else if (target.actor && target.actor instanceof Clutter.Actor) {
             state.actor = target.actor;
-            state.destroyedId = target.actor.connect('destroy', () => { _actorDestroyed(target); });
+            state.destroyedId = target.actor.connect('destroy', () => _actorDestroyed(target));
         }
     }
 
@@ -86,7 +86,7 @@ function _addHandler(target, params, name, handler) {
             handler(target);
         };
     } else {
-        params[name] = () => { handler(target); };
+        params[name] = () => handler(target);
     }
 }
 
index 671684a6b6eeb951af8d5e2ba6f4381ef84e687b..701f97e88e5db37710a630dcca8b709d5693ddf2 100644 (file)
@@ -66,9 +66,9 @@ var Source = class WindowAttentionSource extends MessageTray.Source {
         this.signalIDs.push(this._window.connect('notify::urgent',
                                                  this._sync.bind(this)));
         this.signalIDs.push(this._window.connect('focus',
-                                                 () => { this.destroy(); }));
+                                                 () => this.destroy()));
         this.signalIDs.push(this._window.connect('unmanaged',
-                                                 () => { this.destroy(); }));
+                                                 () => this.destroy()));
     }
 
     _sync() {
index f3b99b51ef6fc584d86df5dbdd5dc02dca8ba336..6ff952da7b30b3c4fa360f3cae0faecd8d68c65c 100644 (file)
@@ -1106,7 +1106,7 @@ var WindowManager = class {
 
     _showPadOsd(display, device, settings, imagePath, editionMode, monitorIndex) {
         this._currentPadOsd = new PadOsd.PadOsd(device, settings, imagePath, editionMode, monitorIndex);
-        this._currentPadOsd.connect('closed', () => { this._currentPadOsd = null; });
+        this._currentPadOsd.connect('closed', () => this._currentPadOsd = null);
 
         return this._currentPadOsd.actor;
     }
index 0b0593c18917a6af294b1a7bed4b97444e25d923..34c0b1f0c71defcf17db474f1cb5b9ff48807c02 100644 (file)
@@ -152,11 +152,11 @@ var WindowClone = class {
         this.actor.connect('destroy', this._onDestroy.bind(this));
         this.actor.connect('key-press-event', this._onKeyPress.bind(this));
 
-        this.actor.connect('enter-event', () => { this.emit('show-chrome'); });
-        this.actor.connect('key-focus-in', () => { this.emit('show-chrome'); });
+        this.actor.connect('enter-event', () => this.emit('show-chrome'));
+        this.actor.connect('key-focus-in', () => this.emit('show-chrome'));
 
-        this.actor.connect('leave-event', () => { this.emit('hide-chrome'); });
-        this.actor.connect('key-focus-out', () => { this.emit('hide-chrome'); });
+        this.actor.connect('leave-event', () => this.emit('hide-chrome'));
+        this.actor.connect('key-focus-out', () => this.emit('hide-chrome'));
 
         this._draggable = DND.makeDraggable(this.actor,
                                             { restoreOnSuccess: true,